class Solution:
    def twoSum(self, nums: List[int], target: int) -> List[int]:
        N = {}
        for i, n in enumerate(nums):
            if target - nums[i] not in N:
                N[n] = i
            else:
                return [N[target-nums[i]], i]

if __name__ == '__main__':
    s = Solution()
    print(s.twoSum(nums = [2,7,11,15], target = 9))
    print(s.twoSum(nums = [3,2,4], target = 6))
    print(s.twoSum(nums = [3,3], target = 6))